package cn.tedu.mvc;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

//完成springmvc的角色，接受请求和给出响应
@RestController//是一个控制器
@RequestMapping("car")
public class HelloController {
    @RequestMapping("get")
    public String num(){
        return "132";
    }
    @RequestMapping("set")
    public int num2(){
        return 100;
    }
    @RequestMapping("mess")
    public Car mess(){
        Car car = new Car(718,"保时捷","Cayman  T","red",641000.0);
//        car.setId(718);
//        car.setName("保时捷");
//        car.setType("Cayman  T");
//        car.setColor("red");
//        car.setPrice(641000.0);
        return car;
    }
    @RequestMapping("char")
    public int[] charget(){
        int[] a = {1,4,3,3,2,2,3};
        return a;
    }
    @RequestMapping("sum")
    public Object sum(){
        return num()+" "+num2()+" "+mess()+" "+charget();
    }
}
